var xmlHttp;
var userid;
function create(){
	if(window.XMLHttpRequset){
		xmlHttp = new XMLHttpRequest();
	}else if(window.ActiveXObject){
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
}

function updaterun(id,atype){
	create();
	
	userid = id;
	
	url = "ChangeStateServlet.do?id=" + id + "&type=" + atype;
	
	
	$.ajax({
		type:"post",
		url:url,
		dataType:"html",
		cache:false,
		success:function call(v){
		   if( v == "0" ){
				alert("update failed" );
			}else if(v == "1"){
				window.location.reload();
			}
		},
		error:function errorcall(){
			alert("server error!");
		}
	});
	
}

